package cn.edu.scau.cmi.ningkehua.adapter;

import java.util.ArrayList;
import java.util.List;
//import cn.edu.scau.cmi.yanghaorui.adapter.*;
//import application.Student;

//import application.Student;

public class ClassAdapter extends SortUtil implements Target {
	@Override
	public List<Integer> sortInt(List<Integer> list){
		for (int i = 0; i < list .size(); i++)    {  
	        for (int j = list .size()-1; j > i; j--)  {  
	            int no= list .get(j);
	            int no_1= list .get(j-1);
	            if (no<no_1)    {  
	                  //互换位置
	                 int  stu = list.get(j);
	                 list.set(j, list.get(j-1));
	                 list.set(j-1, stu );
	            }  
	        }  
	    } 
	   
 	   return list;
	}

	@Override
	public List<Student> sortStudent(List<Student> list) {
		for (int i = 0; i < list .size(); i++)    {  
	        for (int j = list .size()-1; j > i; j--)  {  
	            int no= list .get(j).getNumber();
	            int no_1= list .get(j-1).getNumber();
	            if (no<no_1)    {  
	                  //互换位置
	                 Student  stu = list.get(j);
	                 list.set(j, list.get(j-1));
	                 list.set(j-1, stu );
	            }  
	        }  
	    } 
		return list;
		
		
	}
	public static List<Student> list_stu=new ArrayList<Student>();
	
		
	
	/*Student student1;
	Student student2;
	List<Student> list=new ArrayList<Student>();
	public void getStudent() {
		Student t=new Student();
		t.setName("zhangsan");
		t.setNumber(9);
		this.student1=t;
		Student t2=new Student();
		t2.setName("lisi");
		t2.setNumber(8);
		this.student2=t2;
		this.list.add(t);
		this.list.add(t2);
	
		this.list=sortInt(this.list);
		 for(Student s:this.list) {
			 System.out.println(s);
		 }
			  
	}*/
	

}
